﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HRM.Entity;

namespace HRM.DAL
{
    public class LeaveTypeDAL: BaseDAL
    {
        public List<LeaveType> GetAll()
        {
            return Repository.All<LeaveType>().ToList();
        }

        public LeaveType GetByID(int ID)
        {
            return Repository.Single<LeaveType>(item => item.ID == ID);
        }

        public LeaveType Add(LeaveType item)
        {
            Repository.Add<LeaveType>(item);
            return item;
        }

        public LeaveType Update(LeaveType item)
        {
            Repository.Update<LeaveType>(item);
            return item;
        }

        public void Delete(int ID)
        {
            Repository.Delete<LeaveType>(ID);
        }
    }
}
